<?php

session_start();

require(dirname(__FILE__).'/config/config.inc.php');

$email = htmlspecialchars($_POST['email']);
// echo $email;
$pass = htmlspecialchars($_POST['passwd']);
// echo $pass;
$customer = new Customer();
$customer = $customer->getByEmail($email, $pass,true);
//echo $customer;
if( $customer ){
	$_GET['controller'] = 'authentication';
	$_POST['back'] = 'my-account';
	$_POST['SubmitLogin'] = '';
	$_SESSION['logged'] = true;
	require('index.php');
}
else
	echo "Identifiant ou mot de passe incorrect";
?>